#include<iostream>
#include<string>
#include"log.hpp"
#include"TcpServer.hpp"
#include"Common.hpp"
#include"InetAddr.hpp"
#include<memory>




std::string StringEcho(std::string& str)
{
    std::string ret="client say:";
    return ret+str;
}

//server port
int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        std::cout<<"Server ip"<<std::endl;
        exit(ExitCode::USAGE_ERR);
    }

    uint16_t port=std::stoi(argv[1]);


    std::shared_ptr<Server> server=std::make_shared<Server>(port,StringEcho);
    server->Init();
    server->Start();




    



    return 0;
}